   
           
 
            DECLARE	@return_value int,
            @resultsql_1 nvarchar(max)
            EXEC	@return_value =[LANSUNERP]. [dbo].[GenerateTaskList]
            @table_name = N'WorkFlowJobPropertyList',
            @table_Short = N'GC',
            @tableid = N'*',
            @SysID = N'1',
            @conditions = N'1=2',
            @resultsql_1 = @resultsql_1 OUTPUT
  
 
                USE [LANSUNERPQueryCond]
                GO
                SET ANSI_NULLS ON
                GO
                SET QUOTED_IDENTIFIER ON
                GO
                SET ANSI_PADDING ON
                GO
				 DROP TABLE [dbo].[WorkFlowJobPropertyListQueryCond]
                GO
                CREATE TABLE [dbo].[WorkFlowJobPropertyListQueryCond](
                [QueryType] [nvarchar](50) NOT NULL,[ConditionType] [nvarchar](250) NOT NULL,[Reason1] [nvarchar](100) NULL,[FKeyInstanceTable] [nvarchar](100) NULL,[SysID] [nvarchar](10) NULL,
[KeyDefType] [nvarchar](10) NULL,
[GoodsTypeKey] [nvarchar](2) NULL,
[GoodsTypeKeyDefKey] [nvarchar](40) NULL,
[GoodsKey] [nvarchar](50) NULL,
[GoodsKeyID] [nvarchar](50) NULL,
[PropertyListKey] [nvarchar](256) NULL,
[PropertyListID] [nvarchar](256) NULL,
[PropertyKey] [nvarchar](256) NULL,
[PropertyID] [nvarchar](256) NULL,
[LongDes] [nvarchar](250) NULL,
[ShortDes] [nvarchar](100) NULL,
[ExtenedProperty] [nvarchar](40) NULL,
[PositionID] [int] NULL,
[LastPositionID] [int] NULL,
[SubStatus] [nvarchar](max) NULL,
[Status] [nvarchar](50) NULL,
[FrstUser] [nvarchar](10) NULL,
[FrstDate] [datetime] NULL,
[LastUser] [nvarchar](10) NULL,
[LastDate] [datetime] NULL,
[InstanceID] [nvarchar](256) NULL,
[InstanceKey] [nvarchar](256) NULL 
 )  

GO

SET ANSI_PADDING OFF
GO
                            DECLARE	@return_value int,
            @resultsql_1 nvarchar(max)
            EXEC	@return_value = [LANSUNERP].[dbo].[GenerateTaskList]
            @table_name = N'WorkFlowJobPropertyListQueryCond',
            @table_Short = N'GC',
            @tableid = N'*',
            @SysID = N'1',
            @conditions = N'1=2',
            @resultsql_1 = @resultsql_1 OUTPUT
            GO
            INSERT INTO [LANSUNERPQueryCond].[dbo].[WorkFlowJobPropertyListQueryCond]
           ([QueryType],[ConditionType],[SysID])VALUES ('QueryOnly','IX_WorkFlowJobPropertyList_SysID','1')
GO 
 
 BEGIN TRANSACTION
 SET QUOTED_IDENTIFIER ON
SET ARITHABORT ON
SET NUMERIC_ROUNDABORT OFF
SET CONCAT_NULL_YIELDS_NULL ON
SET ANSI_NULLS ON
SET ANSI_PADDING ON
SET ANSI_WARNINGS ON
COMMIT
BEGIN TRANSACTION
GO
 DROP INDEX IX_GoodsType ON [LANSUNERP].dbo.WorkFlowJobPropertyList
GO
CREATE NONCLUSTERED INDEX IX_GoodsType ON [LANSUNERP].dbo.WorkFlowJobPropertyList
 (
SysID,GoodsTypeKey
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
 DROP INDEX IX_WorkFlowJobPropertyList ON [LANSUNERP].dbo.WorkFlowJobPropertyList
GO
CREATE NONCLUSTERED INDEX IX_WorkFlowJobPropertyList ON [LANSUNERP].dbo.WorkFlowJobPropertyList
 (
SysID,KeyDefType,GoodsTypeKey,GoodsTypeKeyDefKey,GoodsKey
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
 DROP INDEX IX_WorkFlowJobPropertyList_Key ON [LANSUNERP].dbo.WorkFlowJobPropertyList
GO
CREATE NONCLUSTERED INDEX IX_WorkFlowJobPropertyList_Key ON [LANSUNERP].dbo.WorkFlowJobPropertyList
 (
SysID,KeyDefType,GoodsTypeKey,GoodsTypeKeyDefKey,GoodsKey
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
 DROP INDEX IX_WorkFlowJobPropertyList_LikeAny ON [LANSUNERP].dbo.WorkFlowJobPropertyList
GO
CREATE NONCLUSTERED INDEX IX_WorkFlowJobPropertyList_LikeAny ON [LANSUNERP].dbo.WorkFlowJobPropertyList
 (
SysID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
 DROP INDEX IX_WorkFlowJobPropertyList_SysID ON [LANSUNERP].dbo.WorkFlowJobPropertyList
GO
CREATE NONCLUSTERED INDEX IX_WorkFlowJobPropertyList_SysID ON [LANSUNERP].dbo.WorkFlowJobPropertyList
 (
SysID
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
 DROP INDEX TX_WorkFlowJobPropertyList ON [LANSUNERP].dbo.WorkFlowJobPropertyList
GO
CREATE NONCLUSTERED INDEX TX_WorkFlowJobPropertyList ON [LANSUNERP].dbo.WorkFlowJobPropertyList
 (
SysID,KeyDefType,GoodsTypeKey,GoodsTypeKeyDefKey,GoodsKey
) WITH( STATISTICS_NORECOMPUTE = OFF, IGNORE_DUP_KEY = OFF, ALLOW_ROW_LOCKS = ON, ALLOW_PAGE_LOCKS = ON) ON [PRIMARY]
GO
ALTER TABLE [LANSUNERP].dbo.WorkFlowJobPropertyList  SET (LOCK_ESCALATION = TABLE)
GO
COMMIT


  

